require "../config.pl";

############################## КАПЧА!!##########################################################################
use Authen::Captcha;
use Digest::MD5 qw( md5_hex );
my $cap_data_folder = "$DOC_ROOT/tmp/captcha"; # Здесь будет находиться текстовый файл с кодами CAPTCHA
my $cap_out_folder = "$DOC_ROOT/tmp/captcha/img"; # Тут расположены проверочные изображения CAPTCHA
my $cap_length = 6; # Из скольки символов будет состоять капча
my $captcha = Authen::Captcha->new( data_folder => $cap_data_folder, output_folder => $cap_out_folder,);
my $md5sum = $captcha->generate_code($cap_length);
#################################################################################################################

#$sorry = qq{<h2><span style="color:red;">Регистрация закрыта до утра приносим извинения у нас работы ((</span></h2>};

print "Content-Type: text/html; charset=utf-8\n\n";
print qq{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>$SITE_NAME :: Регистратура</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="google-site-verification" content="f0gMQ61JYuKLCaqzRcxR0GhyenGayG0_rFlA1-ZmgL0" />
	
	<link rel="stylesheet" type="text/css" href="/style/style.css" media="screen" title="style (screen)" />

	<script type="text/javascript" src="/js/core.js"></script>
	<script type="text/javascript" src="/js/reg.js"></script>
	<!-- Yandex.Metrika -->
		<script src="//mc.yandex.ru/metrika/watch.js" type="text/javascript"></script>
		<script type="text/javascript">
		try { var yaCounter641784 = new Ya.Metrika(641784); } catch(e){}
		</script>
		<noscript><img src="//mc.yandex.ru/watch/641784" style="position:absolute" alt="" /></noscript>
	<!-- /Yandex.Metrika -->
	
	<style type="text/css">
		.imp {
			color: red;
		}
		#f1_upload_process{
			   z-index:100;
			   position:absolute;
			   visibility:hidden;
			   text-align:center;
			   width:400px;
			   margin:0px;
			   padding:0px;
			   background-color:#fff;
			   border:1px solid #ccc;
			}
			
		
	</style>
</head>
<body >
	<div id="preload"></div>
	<div id="header">};
print qq{
	<h1>$uname[3]<span>\@$SITE_NAME2</span></h1>};#???????? ЧТО ЭТО !!! ~4.02.10
print qq{
	<big>$SITE_NAME</big> </div>};
print qq{
	<div id="menu">
	<!--<ul>&nbsp;</ul>-->
	</div>
	<div id="main">
		<div id="container">
			<div id="subnav">
				<ul>
					<li><a href="/">На главную</a></li>
				</ul>
			</div>
			<!--проебаные события-->
			    <div id="extras">		
				<h2>Пропущено</h2>
				<ul>
					<li>
						<p>Добавлен <a href="../search/search_username.pl">поиск пользователей</a></p>
					</li>
					<li>
						<p><a href="http://sos20.livejournal.com/4823.html">График</a> работ по выпуску 0.2</p>
					</li>
					<li>
						<p>Состоялся релиз версии 0.1, у нас не большой перерыв и дальше, в гору)</p>
					</li>
				</ul>
				<hr />
				<p><a href="http://www.openwebdesign.org/">Open Web Design</a><br />
				<a rel="nofollow" href="http://validator.w3.org/check?uri=referer">XHTML 1.0 Strict</a><br />
				<a rel="nofollow" href="http://jigsaw.w3.org/css-validator/check/referer">Valid CSS</a> </p>
				<p>
					<a href="http://jigsaw.w3.org/css-validator/check/referer">
						<img style="border:0;width:88px;height:31px"
							src="/image/vcss-blue.gif"
							alt="Правильный CSS!" />
					</a>
					<a href="http://validator.w3.org/check?uri=referer">
						<img style="border:0;width:88px;height:31px"
						src="/image/valid-xhtml10-blue.png"
						alt="Правильный XHTML 1.0!" height="31" width="88" />
					</a>
					<!-- begin of Top100 logo -->
					<a href="http://top100.rambler.ru/home?id=1969977" target="_blank"><img src="http://top100-images.rambler.ru/top100/banner-88x31-rambler-gray2.gif" alt="Rambler's Top100" width="88" height="31" border="0" /></a>
					<!-- end of Top100 logo -->
				</p>
			</div>
			<div id="content">
				<h1>Регистрация</h1>
				<h2>Начнем...</h2>
				$sorry
				<p>
				Для регистрации, пожалуйста, оставьте нам информацию о Вас. С особой внимательностью заполняйте поля, помеченные красной звездочкой, так как информация из них нужна для работы на сайте.
				</p>
				<!--<form action="http://xepec.ru/reg/upload.php" method="post" enctype="multipart/form-data">-->
				<form action="ok-reg.pl" name="register" method="post" enctype="multipart/form-data" target="upload_target" onsubmit="startUpload();" >
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td class="td1"><span class="imp">*</span>Логин:</td>
							<td>
								<input type="text" size="20" maxlength="100" id="nic" name="nic" value="" onkeyup="check_nic();"/>
							</td>
							<td width="500px">
								<span onclick="check_nic();" title="Проверить" >
									<img src="/image/reload.gif" style="border:0;" width="12px" height="13px" alt="Проверить" />
								</span>
							<label id="message">&nbsp;</label></td>
						</tr>
						<tr>
							<td class="td1"><span class="imp">*</span>Пароль:</td>
							<td><input type="password" onkeyup="check_pass_value();" size="20" maxlength="100" name="pass1" id="pass1" /></td>
							
							<td rowspan="2"><label id="message_pass" style="float: left;" >&nbsp;</label></td>
						</tr>
						<tr>
							<td class="td1"><span class="imp">*</span>Повторите пароль:</td>
							<td><input type="password" onkeyup="check_pass_value();" size="20" maxlength="100" id="pass2" /></td>
						</tr>
						
						<tr>
						<td>&nbsp;</td>
						<td colspan="2">&nbsp;</td>
						</tr>
						
						<tr>
							<td class="td1"><span class="imp">*</span>E-mail:</td>
							<td colspan="2"><input type="text" size="15" maxlength="100" name="mail" value="" id="mail" />
							
							<label id="message_email">&nbsp;</label></td>
						</tr>
						<tr>
							<td class="td1">ФИО:</td>
							<td colspan="2"><input type="text" size="45" maxlength="100" name="name" value="" id="name" /></td>
						</tr>
						<tr>
							<td class="td1"><span class="imp">*</span>Пол:</td>
							<td colspan="2"><span style="color: red">♀</span><input type="radio" name="sex" value="8" id="sex0"/><span style="color: blue">♂</span><input type="radio" name="sex" value="1" id="sex1"/>
							<label id="message_sex">&nbsp;</label>
							</td>
						</tr>
						
						<tr>
							<td class="td1">Дата рождения: </td>
							<td colspan="2"><input type="text" size="2" maxlength="2" name="bday" value="" id="bday" />-<input type="text" size="2" maxlength="2" name="bmonth" value="" id="bmonth" />-<input type="text" size="4" maxlength="4" name="byear" value="" id="byear" /><span style="color: #9C9C9C">дд-мм-гггг</span></td>
						</tr>
						<tr>
							<td class="td1">Телефоны:</td>
							<td colspan="2">
								<div id="phone_global">
									<!--<input type="text" size="2" maxlength="4" name="phone_country" id="phone_country" value="" />(<input type="text" size="5" maxlength="5" name="phone_city" id="phone_city" value="" />)<input type="text" size="7" maxlength="7" name="phone_number" id="phone_number" value="" />-->
									<div name="phone-type-select">
										Добавить:
										<div style="display: inline; font-size: 0.8em;">
										<a onclick="phone_add('mob');"><img src="/image/phone/phone_mob.png" width="10px" title="Мобильный"/>&#160;Мобильный</a>,
										<a onclick="phone_add('home');"><img src="/image/phone/phone_home.png" width="12px" title="Домашний"/>&#160;Домашний</a>,
										<a onclick="phone_add('work');"><img src="/image/phone/phone_work.png" width="12px" title="Рабочий"/>&#160;Рабочий</a>,
										<a onclick="phone_add('other');"><img src="/image/phone/phone_other.png" width="12px" title="Другой"/>&#160;Другой</a>.
										</div>
										<!--<input type="button" onclick="phone_add();" id="phone-add-button" width="8px" value="добавить" />-->
									</div>
									<div id="phone-add-div" name="put">
										<div id="phone_mob" style="display:none"><img src="/image/phone/phone_mob.png" width="12px" title="Мобильный"/>:&#160;+<input type="text" size="2" maxlength="4" name="phone_country_mob" id="phone_country_mob" value="" />(<input type="text" size="5" maxlength="5" name="phone_city_mob" id="phone_city_mob" value="" />)<input type="text" size="7" maxlength="7" name="phone_number_mob" id="phone_number_mob" value="" /><span class="imp" title="Удалить" onclick="phone_add('mob');">X</span></div>
										<div id="phone_home" style="display:none"><img src="/image/phone/phone_home.png" width="12px" title="Домашний"/>:&#160;+<input type="text" size="2" maxlength="4" name="phone_country_home" id="phone_country_home" value="" />(<input type="text" size="5" maxlength="5" name="phone_city_home" id="phone_city_home" value="" />)<input type="text" size="7" maxlength="7" name="phone_number_home" id="phone_number_home" value="" /><span class="imp" title="Удалить" onclick="phone_add('home');">X</span></div>
										<div id="phone_work" style="display:none"><img src="/image/phone/phone_work.png" width="12px" title="Рабочий"/>:&#160;+<input type="text" size="2" maxlength="4" name="phone_country_work" id="phone_country_work" value="" />(<input type="text" size="5" maxlength="5" name="phone_city_work" id="phone_city_work" value="" />)<input type="text" size="7" maxlength="7" name="phone_number_work" id="phone_number_work" value="" /><span class="imp" title="Удалить" onclick="phone_add('work');">X</span></div>
										<div id="phone_other" style="display:none"><img src="/image/phone/phone_other.png" width="12px" title="Другой"/>:&#160;+<input type="text" size="2" maxlength="4" name="phone_country_other" id="phone_country_other" value="" />(<input type="text" size="5" maxlength="5" name="phone_city_other" id="phone_city_other" value="" />)<input type="text" size="7" maxlength="7" name="phone_number_other" id="phone_number_other" value="" /><span class="imp" title="Удалить" onclick="phone_add('other');">X</span></div>
									</div>
								</div>
								<div id="null" style="display:none">
									<textarea id="phone" name="phone"></textarea>
								</div>
							</td>
						</tr>
						<tr>
							<td class="td1">IM:</td>
							<td colspan="2"><img src="/image/im/icq.png" height="16px" /><input type="text" size="10" maxlength="100" name="im" id="im" /></td>
						</tr>
						<tr>
							<td class="td1">О себе:</td>
							<td colspan="2"><textarea cols="35" rows="5" name="about" id="about"></textarea></td>
						</tr>
						<tr>
							<td class="td1">Интересы: </td>
							<td colspan="2"><textarea cols="35" rows="5" name="interes" id="interes"></textarea></td>
						</tr>
						<tr>
							<td class="td1">Цитаты: </td>
							<td colspan="2"><textarea cols="35" rows="5" name="citata" id="citata"></textarea></td>
						</tr>
						<tr>
							<td class="td1">Фотография: </td>
							<td colspan="2"><input type="file" name="filename" id="filename" /></td>
						</tr>
						<tr>
							<td class="td1"></td>
							<td colspan="2">
								<p>Давайте убедимся что вы не робот))</p>
								
								<div id="captcha_img" style="height: 35px;">
									<img src="/tmp/captcha/img/$md5sum.png" />
									<span onclick="reload_captcha();" title="Перегрузить" >
										<img src="/image/reload.gif" style="border:0;" width="12px" height="13px" alt="Перегрузить" />
									</span>
								</div>
							</td>
						</tr>
						<tr>
							<td class="td1"><span class="imp">*</span>Введите цифры и буквы: </td>
							<td colspan="2">
								<input type="text" size="6" maxlength="6" name="captcha" value="" id="captcha" />
							</td>
						</tr>
					</table>
					<p>Подтверждение регистрации придет на указанный Вами e-mail в течение минуты.
						<br />
						$sorry
						<p id="f1_upload_process">Loading...<br/><img src="/image/ajax-loader.gif" /></p>
						<p id="result"></p>
						<!--<input type="submit" name="send" id="send" value="Продолжить..." />-->
						<input type="button" onclick="check();" id="send" name="send" value="Продолжить..." />
						<iframe id="upload_target" name="upload_target" src="#" style="width:0;height:0;border:0px solid #fff;"></iframe>    
					</p>
				</form>
				<div id="footer">
					Template by <a style="color: #666;"href="http://creativecommons.org/">CC:by-sa</a> | &copy; xepec.ru | v. 0.2
					<!-- begin of Top100 code -->
					<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?1969977"></script><noscript><img src="http://counter.rambler.ru/top100.cnt?1969977" alt="" width="1" height="1" border="0"/></noscript>
					<!-- end of Top100 code -->
				</div>
			</div><!-- content -->
		</div><!-- container -->
	</div><!-- main -->
</body>
</html>
};
